<template>
  <div id="setting">
<NavBar>
  <div slot="left" class="left" @click="return_before"><van-icon name="arrow-left" /></div>
  <div slot="center">设置</div>
</NavBar>
    <div class="cell_1"><van-cell title="单元格" is-link value="内容" /></div>
    <div class="cell_2">
     <div @click="clickaddress"> <van-cell title="我的收货地址" is-link /></div>
      <van-cell title="单元格" is-link value="内容" />
    </div>
    <div class="cell_3">
<!--      <van-cell title="历史浏览商品记录" is-link @click="$router.push('/history_goods')"/>-->
      <van-cell title="单元格" is-link value="内容" />
      <van-cell title="单元格" is-link value="内容" />
    </div>
    <div class="cell_4" @click="logout_sure">
      <van-cell title="退出登录"  />
    </div>
    <van-dialog v-model="show" title="提示" show-cancel-button width="300px" @confirm="delete_user">
<!--        <img src="https://img01.yzcdn.cn/vant/apple-3.jpg" />-->
<div class="try">您确定要退出登录吗</div>
</van-dialog>
    </div>
</template>

<script>
import NavBar from "@/components/common/NavBar/NavBar";
import {formLogout} from "@/network/Users/logout";

export default {
name: "Setting",
  components: {NavBar},
  data(){
  return {
    show:false
  }
  }
  ,
  methods:{
  return_before(){
    history.go(-1)
  },
    logout_sure(){

      this.show=!this.show
    },
    delete_user(){
    formLogout().then(
        res=>{
          console.log(res);
          this.$router.push('/login')
        }
    )
    },
    clickaddress(){
    this.$router.push('/addressmanage')
    }
}
}
</script>

<style scoped>
.left .van-icon {
    font-size: 20px;
    position: relative;
    top: 3px;
    left: -8px;
}
#setting{
  background-color: rgb(247,248,250);
  height: 1000px;
}
.cell_1,.cell_3{
  padding: 15px 0px;
}
.cell_4 > div:nth-child(1) > div:nth-child(1) > span:nth-child(1){
  font-size: 13px;
color: red;
margin-left: 5px;
}
.van-dialog__content{
  height: 100px;
}
/*html body.van-overflow-hidden div#app div#setting div.van-dialog div.van-dialog__content img{*/
/*  height: 100px;*/
/*}*/
.try{

  height: 100px;
text-align: center;
padding-top: 35px;
}
</style>
